package Service;

import Dao.yuliangDao;
import domain.yuliang;

import java.sql.SQLException;
import java.util.List;

public class yuliangService {
      yuliangDao yuliangDao=new yuliangDao();
    /*查询所有信息*/
    public List<yuliang> findAll(List list) throws SQLException {
        String sql ="select * from rainquality where 1=1";
        return yuliangDao.findAll(sql,list);
    }

    /*修改信息*/
    public int update( List list){
        String sql ="update rainquality set districtName=?,monitorTime=?,rain=?,monitoringStation=?,monitoringAddress=? where id=?";
        return yuliangDao.update(sql,list);

    }

    /*删除*/

    public int delete(List list){
        String sql ="delete from rainquality where id=?";
        return yuliangDao.delete(sql,list);
    }
    /*新增信息*/
    public int xz(List list) throws SQLException {
        String sql="INSERT INTO rainquality (districtName, monitorTime,rain,monitoringStation,monitoringAddress) VALUES (?,?,?,?,?)";
        return yuliangDao.xz(sql,list);
    }
}
